import request from './index'

/*
* 新增项目
* */
export function addProjectName(data) {
    return request({
        url: "/api/project/add",
        method: "POST",
        data
    })
}
export function delProjectName(data) {
    return request({
        url: "/api/project/delete",
        method: "POST",
        data
    })
}
export function projectList(data) {
    return request({
        url: "/api/project/list",
        method: "POST",
        data
    })
}
export function projectUpdate(data) {
    return request({
        url: "/api/project/update",
        method: "POST",
        data
    })
}
/*
材料列表
 */
export function addMaterial(data) {
    return request({
        url: "/api/material/add",
        type: "json",
        method: "POST",
        data
    })
}
export function updMaterial(data) {
    return request({
        url: "/api/material/update",
        type: "json",
        method: "POST",
        data
    })
}
export function delMaterial(data) {
    return request({
        url: "/api/material/delete",
        method: "POST",
        data
    })
}
export function listMaterial(data) {
    return request({
        url: "/api/material/list",
        method: "POST",
        data
    })
}

export function materialTypeList() {
    return request({
        url: "/api/material/materialClassifyList",
        method: "POST",
    })
}



/*
    新增材料分类
 */
export function addMaterialClassify(data) {
    return request({
        url: "/api/materialClassify/add",
        method: "POST",
        data
    })
}
export function delMaterialClassify(data) {
    return request({
        url: "/api/materialClassify/del",
        method: "POST",
        data
    })
}
export function listMaterialClassify(data) {
    return request({
        url: "/api/materialClassify/list",
        method: "POST",
        data
    })
}
export function updateMaterialClassify(data) {
    return request({
        url: "/api/materialClassify/update",
        method: "POST",
        data
    })
}


/*

    新增用户
 */
export function addUser(params) {
    return request({
        url: "/api/user/add",
        method: "POST",
        params
    })
}
export function delUser(data) {
    return request({
        url: "/api/user/delete",
        method: "POST",
        data
    })
}
export function listUser(data) {
    return request({
        url: "/api/user/list",
        method: "POST",
        data

    })
}
export function updateUser(data) {
    return request({
        url: "/api/user/update",
        method: 'POST',
        data
    })
}
//审核进度流程
export function auditingSchedule() {
    return request({
        url: "/api/auditingSchedule/list"
    })
}

//用户报销列表
export function userReimbursedRecord(data) {
    return request({
        url: "/api/reimbursed/reimbursedRecord",
        method: "POST",
        data
    })
}
export function taskDetail(data) {
    return request({
        url: "/api/reimbursed/userReimbursedRecordDetail",
        method: "POST",
        data
    })
}

export function exportDetail() {
    return request({
        url: "/api/reimbursed/export"
    })
}
//添加协议
export function addUserAgreement(data) {
    return request({
        url: '/userAgreement/add',
        method: "post",
        data,
        type: "json"
    })
}
export function queryUserAgreement(data) {
    return request({
        url: 'userAgreement/list',
        method: "post",
        data,
    })
}

//科目列表
export async function subjectList(data) {
    return request({
        url: 'subject/oneLevelSubjectList',
        method: "post",
        data,
    })
}
//新增科目
export function addSubject(data) {
    return request({
        url: 'subject/add',
        method: "post",
        data,
    })
}

//获取科目的所有子级
export function allSubjectList(subjectCode) {
    return request({
        url: 'subject/subjectNextAllSubjectList',
        method: "post",
        data: {
            subjectCode
        }
    })
}


//物料打包记录
export function packRecordList(data) {
    return request({
        url: 'api/material/packRecordList',
        method: "post",
        data
    })
}

//打包物料  
export function packMaterial(data) {
    return request({
        url: 'api/material/pack',
        method: "post",
        type: "json",
        data,
    })
}

//提交入账
export function inEntry(data) {
    return request({
        url: 'subject/subjectTransferAccounts',
        method: "post",
        type: "json",
        data,
    })
}
